<php>
$imgEditConfig = array(	'uploadTmpImgPath'=>U('Admin://ImgEdit/edit',array('t'=>'upload')) //上传临时文件图片路径，未切割图片作准备。
							,'doImgEditPath'=>U('Admin://ImgEdit/edit',array('t'=>'save'))		//进行图片切割并保存
							,'previewPath'=>U('Admin://ImgEdit/preview')
							,'default_alertpic'=>''//默认图片提示图片
							,'relpath'=>'system/hp'//默认图片提示图片
							,'picname'=>'hp_'.time()//默认图片提示图片
							,'towidth'=>1000//默认图片提示图片 707 728
							,'toheight'=>404//默认图片提示图片 253 303
							,'js_fun_after_save'=>'doAfterSave'//保存成功后执行的js方法，只有一个参数保存的图片路径				
	);
</php>
<script>
function doAfterSave(newimgpath){
	//alert(newimgpath);
	$.ajax({      
		url:"{:U('Admin://Global/hpImgEdit')}",      
		type:'post', //数据发送方式  
		data:{newimgpath:newimgpath , newimghref:$('#newimghref').val()} ,    
		async: false ,//同步方式     
		success: function(html){ 
			//alert(html);
			txt = eval('('+html+')');
			if (txt.status==1) {
				k_success('图片更新成功！');
				editHPImg();
			}else {
				k_error('图片更新失败！');
			}
		}
	});
}

</script>

<style>
.hp_topimg{
    border: 1px solid #E2E2E2;
    display: block;
    float: left;
    line-height: 0;
    margin: 10px 0 10px 10px;
    overflow: hidden;
    position: relative;
    width: 270px;
	/**
	width: 270px; height: 145px; float:left;
	border:1px solid #B4B5AF;overflow: hidden;text-align: center; margin:15px;
	**/
}
.hp_topimg em {
    bottom: 3px;
    color: #FFFFFF;
    height: 18px;
    left: 5px;
    line-height: 20px;
    position: absolute;
    text-align: right;
    width: 255px;
    z-index: 2;
}
.hp_topimg em a{
	color: #FFFFFF;
}
.hp_topimg span {
    background: none repeat scroll 0 0 #000000;
    bottom: 1px;
    height: 20px;
    left: 1px;
    opacity: 0.5;
    position: absolute;
    width: 268px;
    z-index: 1;
}
.hp_topimg img {
    height: 145px;
    padding: 1px;
    width: 268px;
}
</style>
<div>
<volist id="vo" name="hpimgs">
	<div class="hp_topimg">
		<em>
			<a href="javascript:void(0);" callback="ajxEditHpImg('{$vo['img']}','href',$('#img_href').val());"
				onclick=" ui.confirm(this,'图片链接：<input type=\\'text\\' style=\\'width:280px;height: 20px; font-size: 12px;line-height: 20px;\\' id=\\'img_href\\' value=\\'{$vo['href']}\\' />'); ">链接</a>
			&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="javascript:void(0)" onclick="ajxEditHpImg('{$vo['img']}','top')">置顶</a>
			&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="javascript:void(0)" onclick="ajxEditHpImg('{$vo['img']}','del')">删除</a>
		</em>
		<span></span>
		<a href="{$vo['href']}" target="_blank">
		<img src="{:getPhotoFromThumb($vo['img'],270,145)}" style="position: relative;">
		</a>
	</div>
</volist>
</div>
<div class="clear"></div>
<div class="edit_panel">
  		<div class="panel-title">
         <ul class="column-tab">
            <li class="tab-title tab-title-current">
            	<a href="javascript:editHPImg();">添加图片</a></li>
            <li class="tab-title tab-title-current">
            	图片链接:<input type="text" id="newimghref"></li>
         </ul>
      </div>

	  <include file="../Admin/Tpl/default/Public/imgEditer.html" />
	  
</div>